import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { Button } from "@eloquent/ui"; import { type FrontmatterProps } from "@/types/mdx"; import { type PageProps } from "@/types/page"; import { siteConfig } from "@/config/siteConfig"; import { getMDXData } from "@/lib/mdx/mdx"; import { CustomMDX } from "@/components/CustomMDX"; import { EditPageLink } from "@/components/EditPageLink"; import { GithubIcon, RadixIcon } from "@/components/Icons"; import { Pagination } from "@/components/Pagination"; import { Prose } from "@/components/Prose"; import { TableOfContents } from "@/components/TableOfContents"; import "@/styles/mdx.scss"; export async function generateMetadata(props: PageProps): Promise { const mdxData = await getMDXData(props.params.slug); const title = mdxData ? mdxData.frontmatter.title : "Page not found"; const description = mdxData ? mdxData.frontmatter.description : siteConfig.siteDescription; return { title: `${title} — Eloquent UI`, description, }; } export default async function DocPage(props: PageProps) { const { slug } = props.params; const mdxData = await getMDXData(slug); if (!mdxData) { notFound(); } const { frontmatter, folderPath, markdown } = mdxData; const { toc: showToc = true, title, description, links } = frontmatter; return ( <>

{title}

{description ? (

{description}

) : null}
{showToc ? : null} ); } function Links({ links }: { links?: FrontmatterProps["links"] }) { if (!links) { return null; } return (
{links.radix ? ( ) : null} {links.source ? ( ) : null}
); }